import org.rsbot.script.wrappers.RSNPC;

class VoluntaryThieve$Actions$2 extends VoluntaryThieve.Action
{
  RSNPC trainer;

  VoluntaryThieve.Action.State perform()
  {
    if (this.trainer == null) {
      if ((this.val$args.length != 1) || (!(this.val$args[0] instanceof RSNPC)))
        throw new IllegalArgumentException();
      this.trainer = ((RSNPC)this.val$args[0]);
    }

    if (!this.trainer.isOnScreen()) return VoluntaryThieve.Action.State.FAILED;
    return this.trainer.doAction(VoluntaryThieve.Options.access$900(VoluntaryThieve.access$800(this.this$1.this$0)) ? "Loot" : "Pickpocket Pickpocketing") ? VoluntaryThieve.Action.State.COMPLETED : VoluntaryThieve.Action.State.PROGRESSING;
  }

  VoluntaryThieve.Action.State finish()
  {
    if (VoluntaryThieve.Actions.access$4500(this.this$1)) {
      VoluntaryThieve.Actions.access$4502(this.this$1, false);
      return VoluntaryThieve.Action.State.COMPLETED;
    }

    return VoluntaryThieve.Action.State.PROGRESSING;
  }
}